import React from 'react'
import { Table } from 'antd';


export default function RoleList(props) {

    return (
        <div className='role-list'>
            <Table scroll={{ x: 'max-content' }} columns={props.columns} dataSource={props.data || []} pagination={
                {
                    total: (props.data && props.data.length) || 0,
                    pageSizeOptions: ['10', '20', '30'],
                    showSizeChanger: true,
                    showQuickJumper: true,
                    defaultCurrent: 1,
                    defaultPageSize: 10,
                    onChange: (page, pageSize) => {
                        console.log(page, pageSize);
                    },
                    showTotal: (total = (props.data && props.data.length) || 0) => (
                        `共${Math.ceil(total / 10)}页/${total}条数据`
                    )
                }
            }></Table>
        </div >
    )
}
